/*
 * constraint.h
 *
 *      Author: Jerome RD Soine and Christoph A Brand
 *      Institution: Schwarz goup, Institute for Theoretical Physics, Heidelberg University, Germany
 */

#ifndef CONSTRAINT_H_
#define CONSTRAINT_H_

#include "../geometry/geomobject.h"
#include "../geometry/base/vertex.h"

#include <vector>

class Constraint{
protected:
	GeomObject * g;
public:
	Constraint(GeomObject * G) { g=G; };
	virtual ~Constraint(){};
	virtual double getDeviation()=0;
	virtual Vertex getGradient(Vertex & v)=0;
	GeomObject * getGeomObject(){ return g; };
	static double getSumOfScalarProductsOfGradientsOverAllVertices(Constraint * c1, Constraint * c2);
	double getSumOfScalarProductsOfGradientsAndForcesOverAllVertices(vector<double> & forces);

	void initialize(){};
};


#endif /* CONSTRAINT_H_ */
